﻿using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CastingWellEquipmentGUI.Model
{
    public class Log : ObservableObject
    {
        #region 数据库中Log表中字段
        /// <summary>
        /// 主键
        /// </summary>
        private int _Id;
        /// <summary>
        /// 主键
        /// </summary>
        public int Id
        {
            get { return _Id; }
            set
            {
                _Id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        /// <summary>
        /// 序号
        /// </summary>
        private int _OrderNo;
        /// <summary>
        /// 序号
        /// </summary>
        public int OrderNo
        {
            get { return _OrderNo; }
            set
            {
                _OrderNo = value;
                RaisePropertyChanged(() => OrderNo);
            }
        }
        /// <summary>
        /// 用户名
        /// </summary>//用户名
        private string _UserName;
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName
        {
            get { return _UserName; }
            set
            {
                _UserName = value;
                RaisePropertyChanged(() => UserName);
            }
        }
        /// <summary>
        /// 操作名称
        /// </summary>
        private string _OperName;
        /// <summary>
        /// 操作名称
        /// </summary>
        public string OperName
        {
            get { return _OperName; }
            set
            {
                _OperName = value;
                RaisePropertyChanged(() => OperName);
            }
        }
        /// <summary>
        /// 操作内容
        /// </summary>
        private string _OperContent;
        /// <summary>
        /// 操作内容
        /// </summary>
        public string OperContent
        {
            get { return _OperContent; }
            set
            {
                _OperContent = value;
                RaisePropertyChanged(() => OperContent);
            }
        }
        /// <summary>
        /// 操作时间
        /// </summary>
        private DateTime _OperTime;
        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OperTime
        {
            get { return _OperTime; }
            set
            {
                _OperTime = value;
                RaisePropertyChanged(() => OperTime);
            }
        }
        /// <summary>
        /// 操作IP
        /// </summary>
        private string _OperIp;
        /// <summary>
        /// 操作IP
        /// </summary>
        public string OperIp
        {
            get { return _OperIp; }
            set
            {
                _OperIp = value;
                RaisePropertyChanged(() => OperIp);
            }
        }
        #endregion 数据库中Log表中字段
        #region 数据库中User表中字段
        /// <summary>
        /// 账号
        /// </summary>
        private string _Account;
        /// <summary>
        /// 账号
        /// </summary>
        public string Account
        {
            get { return _Account; }
            set
            {
                _Account = value;
                RaisePropertyChanged(() => Account);
            }
        }
        #endregion 数据库中User表中字段
        /// <summary>
        /// 排序字段
        /// </summary>
        private int _DataOrderNo;
        /// <summary>
        /// 排序字段
        /// </summary>
        public int DataOrderNo
        {
            get { return _DataOrderNo; }
            set
            {
                _DataOrderNo = value;
                RaisePropertyChanged(() => DataOrderNo);
            }

        }
        /// <summary>
        /// 列表显示格式化之后的操作时间
        /// </summary>
        public string OperTimeText
        {
            get
            {
                if (OperTime != null && OperTime.Ticks != 0)
                {
                    return OperTime.Year + "年" + OperTime.Month.ToString("00") + "月" + OperTime.Day.ToString("00") + "日" + " " + OperTime.Hour.ToString("00") + ":" + OperTime.Minute.ToString("00") + ":" + OperTime.Second.ToString("00");
                }
                return "";
            }
        }
    }
}
